package com.upcode.weighing.vo.req;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.StringUtils;

@Data
@EqualsAndHashCode(callSuper=false)
public class DisableEnableReqVo {

    /**
     * id
     */
    private Long id;

    /**
     * 状态，0 禁用 2 启用
     */
    private Integer status;

    /**
     * 禁用原因
     */
    private String disableReason;

    public String checkParams(){
        if(null == id){
            return "id不可为空";
        }
        if(null == status){
            return "状态不可为空";
        }
        if(status != 0 && status != 2){
            return "状态值不合法";
        }
        if(status == 0 && StringUtils.isBlank(disableReason)){
            return "请输入禁用理由";
        }
        return null;
    }
}
